def start_process(command):
    import subprocess
    """启动一个新进程并返回进程对象"""
    process = subprocess.Popen(command, shell=True)
    return process

def restart_process(process, command):
    """重启给定的进程"""
    process.terminate()  # 终止当前进程
    return start_process(command)  # 启动新进程

def is_process_running(process):
    """检查给定的进程是否仍在运行"""
    return process.poll() is None  # 如果返回 None，表示进程仍在运行